<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>My Title</title>
        <meta charset="utf-8" />
        <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.js"></script>
        <script type="text/javascript">

            // Load exchange rates data via AJAX:
            $.getJSON(
                    // NB: using Open Exchange Rates here, but you can use any source!
                    'https://openexchangerates.org/api/latest.json?app_id=a38cc82d684446178f828670b005bdcd',
                    function (data) {
                        // Check money.js has finished loading:                        
                        console.log("openexchangerates");
                        console.log(data.rates.COP);
                        //console.log(data.rates);                        
                        console.log(data);
                        $('p').text(data.rates.COP);
                    }
            );
            if (typeof (Storage) !== "undefined") {
                if (!sessionStorage.contactoPais) {
                    $.getJSON(
                            'contacto.json',
                            function (data) {
                                console.log("contacto.json");
                                console.log(data);
                                sessionStorage.contactoPais = data.CO;
                            }
                    );
                    var xmlhttp = new XMLHttpRequest();
                    var url = "contacto.json";

                    xmlhttp.onreadystatechange = function () {
                        if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {
                            var a = xmlhttp.responseText;
                            console.log(a);
                            sessionStorage.contact = a;
                            var myArr = JSON.parse(a);
                            console.log(myArr);
                        }
                    };
                    xmlhttp.open("GET", url, true);
                    xmlhttp.send();
                }
            } else {
                document.getElementById("result").innerHTML = "Sorry, your browser does not support web storage...";
            }

            $(document).ready(function () {
                $.ajax({
                    url: 'https://rate-exchange.appspot.com/currency?from=USD&to=COP&q=2160',
                    dataType: 'jsonp',
                    success: function (data) {
                        console.log("rate-exchange");
                        console.log(data);
                    }
                });

            });
        </script>
    </head>
    <body>
        <span>Un Dolar Americano USD cuesta:</span><p></p><span> pesos colombianos</span>
        <br><span>More Info in console</span>
        <!-- DolarWeb Start -->
        <div id="DolarCO1">
            <h2><a href="http://dolar.wilkinsonpc.com.co/">Dolar Hoy</a></h2>
            <a href="http://dolar.wilkinsonpc.com.co/indicadores-economicos-dolar.html">
                Indicadores Economicos
            </a>
        </div>
        <script type="text/javascript" src="http://dolar.wilkinsonpc.com.co/js/dolar-cop-usd-1.js"></script>
        <!-- DolarWeb End -->        
    </body>
</html>